const list = [1, 2, 3, 4];
function print(list) {
    newList.forEach(i => {
        if (i > 2) return;
        console.log(i);
    });
}
print(list);